package com.minimalist.common.feign.client.tc;

import com.minimalist.common.config.mybatis.bo.PageResp;
import com.minimalist.common.entity.tc.entity.vo.order.TcOrderQueryVO;
import com.minimalist.common.entity.tc.entity.vo.order.TcOrderVO;
import com.minimalist.common.feign.config.FeignConfig;
import com.minimalist.common.feign.fallback.tc.TcOrderFeignClientFallbackFactory;
import com.minimalist.common.response.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.util.Map;

/**
 * 车牌交易订单 Feign 客户端
 *
 * @author minimalist
 */
@FeignClient(name = "minimalist-tc", path = "/tc/order", fallbackFactory = TcOrderFeignClientFallbackFactory.class, configuration = FeignConfig.class)
public interface TcOrderFeignClient {

    /**
     * 添加订单
     */
    @PostMapping("/add")
    R<?> addOrder(@RequestBody TcOrderVO orderVO);

    /**
     * 修改订单
     */
    @PutMapping("/update")
    R<?> updateOrder(@RequestBody TcOrderVO orderVO);

    /**
     * 获取订单详情
     */
    @GetMapping("/getOrder/{orderId}")
    R<TcOrderVO> getOrder(@PathVariable("orderId") Long orderId);

    /**
     * 导入订单
     */
    @PostMapping("/importExcel")
    R<Map<String, Object>> importExcel(@RequestPart("file") MultipartFile file);

    /**
     * 分页查询订单列表
     */
    @GetMapping("/getPageOrderList")
    R<PageResp<TcOrderVO>> getPageOrderList(@SpringQueryMap TcOrderQueryVO queryVO);
}